package com.yuxi.excelEntity;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.yuxi.Config.ConfigStatic;
import com.yuxi.Config.PortStaticUtil;
import com.yuxi.Entity.UserTaskCompletion;
import com.yuxi.Util.StringManageUtil;

public class UserCustom {
	private String  id;
	private String informationAccount;//信息id系统生成
	private String informationType;//信息分类(0：监狱，1：监区)
	private String informationSourceNames;
	private String inputPerSonNames=",,";
	private String informationProfile;//信息简介
	private String informationConternt;//信息内容
	private String mesure;//措施
	private String standard;//标准
	private String informationClassificationNames;//
	private String informationSortNames;//	
	private String taskCompletion;//任务完成情况
	private String safetyPortNames;
	private String createTime;//信息创建时间 时间戳	
	private String flowName;
	private String zeRenPerSonNames=",,";
	private String zeRenTime="0";	
	private String ZeRenRemark;
	private String taskDispatchName;
	private String taskDispatchTime;
	private String prisonName;
	private String safePortId;
	private String flowDo;
	private String commentdo;
	private String userId;
	
	
	
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getCommentdo() {
		return commentdo;
	}
	public void setCommentdo(String commentdo) {
		this.commentdo = commentdo;
	}
	public String getFlowDo() {
		return flowDo;
	}
	public void setFlowDo(String flowDo) {
		this.flowDo = flowDo;
	}
	public String getSafePortId() {
		return safePortId;
	}
	public void setSafePortId(String safePortId) {
		this.safePortId = safePortId;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getInformationAccount() {
		return informationAccount;
	}
	public void setInformationAccount(String informationAccount) {
		this.informationAccount = informationAccount;
	}
	public String getInformationType() {
		return informationType;
	}
	public void setInformationType(String informationType) {
		this.informationType = informationType;
	}
	public String getInformationSourceNames() {
		return informationSourceNames;
	}
	public void setInformationSourceNames(String informationSourceNames) {
		this.informationSourceNames = informationSourceNames;
	}
	public String getInputPerSonNames() {
		return inputPerSonNames;
	}
	public void setInputPerSonNames(String inputPerSonNames) {
		this.inputPerSonNames = inputPerSonNames;
	}
	public String getInformationProfile() {
		return informationProfile;
	}
	public void setInformationProfile(String informationProfile) {
		this.informationProfile = informationProfile;
	}
	public String getInformationConternt() {
		return informationConternt;
	}
	public void setInformationConternt(String informationConternt) {
		this.informationConternt = informationConternt;
	}
	public String getMesure() {
		return mesure;
	}
	public void setMesure(String mesure) {
		this.mesure = mesure;
	}
	public String getStandard() {
		return standard;
	}
	public void setStandard(String standard) {
		this.standard = standard;
	}
	public String getInformationClassificationNames() {
		return informationClassificationNames;
	}
	public void setInformationClassificationNames(String informationClassificationNames) {
		this.informationClassificationNames = informationClassificationNames;
	}
	public String getInformationSortNames() {
		return informationSortNames;
	}
	public void setInformationSortNames(String informationSortNames) {
		this.informationSortNames = informationSortNames;
	}
	public String getTaskCompletion() {
		return taskCompletion;
	}
	public void setTaskCompletion(String taskCompletion) {
		this.taskCompletion = taskCompletion;
	}
	public String getSafetyPortNames() {
		return safetyPortNames;
	}
	public void setSafetyPortNames(String safetyPortNames) {
		this.safetyPortNames = safetyPortNames;
	}
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime =(createTime);
	}
	public String getFlowName() {
		return flowName;
	}
	public void setFlowName(String flowName) {
		this.flowName = flowName;
	}
	public String getZeRenPerSonNames() {
		return zeRenPerSonNames;
	}
	public void setZeRenPerSonNames(String zeRenPerSonNames) {
		this.zeRenPerSonNames = zeRenPerSonNames;
	}
	public String getZeRenTime() {
		return zeRenTime;
	}
	public void setZeRenTime(String zeRenTime) {
		this.zeRenTime = zeRenTime;
	}
	public String getZeRenRemark() {
		return ZeRenRemark;
	}
	public void setZeRenRemark(String zeRenRemark) {
		ZeRenRemark = zeRenRemark;
	}
	public String getTaskDispatchName() {
		return taskDispatchName;
	}
	public void setTaskDispatchName(String taskDispatchName) {
		this.taskDispatchName = taskDispatchName;
	}
	public String getTaskDispatchTime() {
		return taskDispatchTime;
	}
	public void setTaskDispatchTime(String taskDispatchTime) {
		this.taskDispatchTime = taskDispatchTime;
	}
	public String getPrisonName() {
		return prisonName;
	}
	public void setPrisonName(String prisonName) {
		this.prisonName = prisonName;
	}
	public UserCustom(int id, String informationAccount, String informationType, String informationSourceNames,
			String inputPerSonNames, String informationProfile, String informationConternt, String mesure,
			String standard, String informationClassificationNames, String informationSortNames, String taskCompletion,
			String safetyPortNames, long createTime, String flowName, String zeRenPerSonNames, String zeRenTime,
			String zeRenRemark, String taskDispatchName, String taskDispatchTime, String prisonName,String portId,int userId) {
		super();
		this.safetyPortNames=PortStaticUtil.getAllpreStr(Integer.parseInt(portId));
		this.id = Integer.toString(id);
		this.userId=Integer.toString(userId);
		this.informationAccount = informationAccount;
		this.informationType = informationType;
		this.informationSourceNames = informationSourceNames;
		this.inputPerSonNames = StringManageUtil.removeDot(inputPerSonNames);
		this.informationProfile = informationProfile;
		this.informationConternt = informationConternt;
		this.mesure = mesure;
		this.standard = standard;
		this.informationClassificationNames = informationClassificationNames;
		this.informationSortNames = informationSortNames;
		
		
		
		List<UserTaskCompletion> list=new Gson().fromJson(taskCompletion, new TypeToken<List<UserTaskCompletion>>(){}.getType());
		if(list!=null){
			for(int i=0;i<list.size();i++){
				UserTaskCompletion u=list.get(i);
				SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
				String dat1 = sdf1.format(new Date(Long.parseLong(u.getTime())));				
				if(u!=null){
					this.taskCompletion+=u.getName()+"("+dat1+"):"+u.getText();
				}				
			}	
		}
		try{
			this.taskCompletion=this.taskCompletion.replaceAll("null", "");
		}catch(Exception e){
			this.taskCompletion="";
		}
		//this.safetyPortNames = safetyPortNames;		
		try{
			SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
			String dat1 = sdf1.format(new Date(createTime));
			this.createTime = dat1;
		}catch(Exception e){
			this.createTime = "";
		}
		this.flowName = flowName;
		this.zeRenPerSonNames = StringManageUtil.removeDot(zeRenPerSonNames);	
		try{
			if(ConfigStatic.LongTimeS.equals(zeRenTime)){
				SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
				String dat1 = sdf1.format(new Date(Long.parseLong(zeRenTime)));
				this.zeRenTime = dat1;
			}else{
				this.zeRenTime = "长期";
			}
		}catch(Exception e){
			this.zeRenTime ="";
		}
		ZeRenRemark = zeRenRemark;
		this.taskDispatchName = taskDispatchName;
		try{
			
				SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
				String dat1 = sdf1.format(new Date(Long.parseLong(taskDispatchTime)));
				this.taskDispatchTime = dat1;			
		}catch(Exception e){
			this.taskDispatchTime ="";
		}	
		this.prisonName = prisonName;
	}
	public UserCustom() {
		super();
	}
	
	
}
